1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method for carrying out a correction process on an input image.
2. Description of the Related Art
Conventionally, there have been proposed various image correction and retouching processes carried out on captured image data by software operating in devices such as digital cameras, digital video cameras, and printers, or in personal computers (PCs).
For example, Japanese Patent Laid-Open No. 2001-313839 describes calculating a color correction amount from image data after performing a tone correction to obtain desired data for a precise color correction, where the tone correction is carried out on image data and then the color correction is carried out.
Additionally, Japanese Patent Publication No. 3584389 describes carrying out a high-contrast process on image data obtained by scanning color negatives, and converting a specific hue in the image data to a desired hue after the high-contrast process.
For example, when an extreme blue fog has occurred in the input image, it is difficult to detect how much of a skin tone is included in the input image, and thus the following scenario can be considered. When some kind of skin tone correction is to be carried out on such an image, a color-fog correction is first carried out on the input image in order to adjust the overall image to an appropriate color balance. The resulting intermediate image is then stored in a memory, a skin tone region is detected from the intermediate image, and the appropriate correction is carried out.
Under the above-described state, by processing the two correction functions for different purposes, that is, the color-fog correction and the skin tone correction, in series, desired image data can be produced.
However, there are two problems with such a method. First, when two corrections are processed in series, a memory for storing the intermediate image of the result of the first process is necessary. Second, for example, in the example described above, the color-fog correction is carried out for each pixel in the input image; therefore, even when the input image is, for example, a relatively small VGA size, 300,000 or more computations are necessary in the color-fog correction.
Therefore, when executing a plurality of image corrections in series on the input image, reducing the size of the input image as much as possible can be considered as a way to decrease the size of the intermediate image and the amount of computation for producing the intermediate image.
However, when the size of the input image and the intermediate image is reduced, the image resolution is reduced by the same amount, thereby making it difficult to accurately calculate an image feature amount for calculating the correction amount, and as a result, it may become difficult to obtain the desired image.
Also, in general image analysis, there has been proposed a method for calculating a one-dimensional histogram for the luminance and each of the RGB components, and calculating image correction parameters by using the histogram.
However, changes in the luminance distribution and the distribution of each of the RGB components cannot be comprehended from such a one-dimensional histogram. For example, the distribution of skin tones, pink, or emerald green cannot be comprehended based on such information, and the only method was to refer to the input image again for the image analysis.